// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import './assets/css/reset.css'
// 引入echarts
import echarts from 'echarts'

Vue.prototype.$echarts = echarts
//引入element-ui
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
//引入axios
import axios from 'axios'
Vue.prototype.$axios = axios
window.axios = axios
// 拦截器
axios.interceptors.request.use(function (config) {
  /*console.log('拦截器：start.config:' + JSON.stringify(config))*/
  return config
}, function (error) {
  // Do something with request error
  /*console.log('拦截器：start.error:' + JSON.stringify(error))*/
  return Promise.reject(error)
})
axios.interceptors.response.use(function (response) {
  // Do something with response data
  /*console.log('拦截器：finish.response:' + JSON.stringify(response))*/
  return response
}, function (error) {
  // Do something with response error
  /*console.log('拦截器：finish.error:' + JSON.stringify(error))*/
  return Promise.reject(error)
})

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
